Skip to content

[Monitor Ingestion] Add typespec generation files #41923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pvaneck
Copy link
Member

@pvaneck pvaneck commented Jul 7, 2025

This regenerates the Ingestion SDK using TypeSpec and tsp-client.

@github-actions github-actions bot added the Monitor Monitor, Monitor Ingestion, Monitor Query label Jul 7, 2025
Copy link

github-actions bot commented Jul 7, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-monitor-ingestion

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
@pvaneck pvaneck force-pushed the ingestion-typespec branch from 7fd96fe to 12441c2 Compare July 10, 2025 09:37
@pvaneck pvaneck requested a review from Copilot July 10, 2025 18:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR regenerates the Azure Monitor Ingestion SDK using TypeSpec, updating both client implementation and tests to align with TypeSpec-generated patterns.

  • Regenerated SDK core files: renamed generator comments, adjusted imports, updated _upload method signatures to use stream_name and JSON encoding via SdkJSONEncoder.
  • Updated tests to open log files in binary mode ("rb") for uploads.
  • Added and reordered package metadata (tsp-location.yaml, MANIFEST.in, apiview-properties.json, and _metadata.json) and sample pylint directives.

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsp-location.yaml New TypeSpec location and commit information for SDK generation
tests/test_logs_ingestion_async.py Switched file open mode to binary for async tests
tests/test_logs_ingestion.py Switched file open mode to binary for sync tests
tests/conftest.py Updated sanitizer regex and placeholder value arguments
samples/async_samples/*.py Added pylint disable directives for line length
aio/_operations/_patch.py Reformatted calls to super()._upload for readability
aio/_operations/_operations.py Adjusted imports and replaced JSON handling with SdkJSONEncoder
aio/_operations/init.py Updated generator comment
aio/_configuration.py Updated generator comment
aio/_client.py Updated generator comment, refactored serializer imports, and left unused _endpoint
aio/init.py Updated generator comment
_utils/utils.py Updated generator comment and refactored mixin base class
_utils/serialization.py Condensed license header and updated generator comment
_utils/model_base.py New generated model base module
_utils/init.py Added generator comment
_operations/_patch.py Reformatted calls to super()._upload for readability
_operations/_operations.py Adjusted imports, renamed parameters, and JSON encoding changes
_operations/init.py Updated generator comment
_configuration.py Updated generator comment and fixed credential scope URL
_client.py Updated generator comment, refactored serializer imports, and left unused _endpoint
init.py Updated generator comment and set __version__
assets.json Updated tag to match latest package version
apiview-properties.json Added cross-language package definitions
_metadata.json Added API version metadata
MANIFEST.in Included py.typed marker and reordered include patterns

:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: The API version to use for this operation. Default value is "2023-01-01".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
_endpoint = "{endpoint}"
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local variable _endpoint is assigned but never used. Consider removing it to clean up the initializer.

Suggested change
_endpoint = "{endpoint}"

Copilot uses AI. Check for mistakes.

:keyword api_version: Api Version. Default value is "2023-01-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: The API version to use for this operation. Default value is "2023-01-01".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
_endpoint = "{endpoint}"
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local variable _endpoint is assigned but never used. It can be removed to simplify the constructor.

Suggested change
_endpoint = "{endpoint}"

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor Monitor, Monitor Ingestion, Monitor Query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant